"use strict";

function _typeof(t) {
    return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) {
        return typeof t
    } : function (t) {
        return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
    })(t)
}
var Util = function (r) {
    var e = !1;

    function t(t) {
        var e = this,
            n = !1;
        return r(this).one(s.TRANSITION_END, function () {
            n = !0
        }), setTimeout(function () {
            n || s.triggerTransitionEnd(e)
        }, t), this
    }
    var s = {
        TRANSITION_END: "bsTransitionEnd",
        getUID: function (t) {
            for (; t += ~~(1e6 * Math.random()), document.getElementById(t););
            return t
        },
        getSelectorFromElement: function (t) {
            var e = t.getAttribute("data-target");
            "#" === (e = !e || "#" === e ? t.getAttribute("href") || "" : e).charAt(0) && (t = e, e = t = "function" == typeof r.escapeSelector ? r.escapeSelector(t).substr(1) : t.replace(/(:|\.|\[|\]|,|=|@)/g, "\\$1"));
            try {
                return 0 < r(document).find(e).length ? e : null
            } catch (t) {
                return null
            }
        },
        reflow: function (t) {
            return t.offsetHeight
        },
        triggerTransitionEnd: function (t) {
            r(t).trigger(e.end)
        },
        supportsTransitionEnd: function () {
            return Boolean(e)
        },
        isElement: function (t) {
            return (t[0] || t).nodeType
        },
        typeCheckConfig: function (t, e, n) {
            for (var r in n)
                if (Object.prototype.hasOwnProperty.call(n, r)) {
                    var i = n[r],
                        o = e[r],
                        o = o && s.isElement(o) ? "element" : {}.toString.call(o).match(/\s([a-zA-Z]+)/)[1].toLowerCase();
                    if (!new RegExp(i).test(o)) throw new Error(t.toUpperCase() + ': Option "' + r + '" provided type "' + o + '" but expected type "' + i + '".')
                }
        }
    };
    return e = ("undefined" == typeof window || !window.QUnit) && {
        end: "transitionend"
    }, r.fn.emulateTransitionEnd = t, s.supportsTransitionEnd() && (r.event.special[s.TRANSITION_END] = {
        bindType: e.end,
        delegateType: e.end,
        handle: function (t) {
            if (r(t.target).is(this)) return t.handleObj.handler.apply(this, arguments)
        }
    }), s
}($);

function _extends() {
    return (_extends = Object.assign || function (t) {
        for (var e = 1; e < arguments.length; e++) {
            var n, r = arguments[e];
            for (n in r) Object.prototype.hasOwnProperty.call(r, n) && (t[n] = r[n])
        }
        return t
    }).apply(this, arguments)
}

function _defineProperties(t, e) {
    for (var n = 0; n < e.length; n++) {
        var r = e[n];
        r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r)
    }
}

function _createClass(t, e, n) {
    return e && _defineProperties(t.prototype, e), n && _defineProperties(t, n), t
}
var ScrollSpy = function (o) {
    var n = "scrollspy",
        i = "bs.scrollspy",
        e = "." + i,
        t = o.fn[n],
        s = {
            offset: 10,
            method: "auto",
            target: ""
        },
        l = {
            offset: "number",
            method: "string",
            target: "(string|element)"
        },
        a = {
            ACTIVATE: "activate" + e,
            SCROLL: "scroll" + e,
            LOAD_DATA_API: "load" + e + ".data-api"
        },
        c = "dropdown-item",
        f = "active",
        r = '[data-spy="scroll"]',
        h = ".active",
        u = ".nav, .list-group",
        g = ".nav-link",
        d = ".nav-item",
        _ = ".list-group-item",
        p = ".dropdown",
        m = ".dropdown-item",
        y = ".dropdown-toggle",
        v = "offset",
        E = "position",
        T = function () {
            function r(t, e) {
                var n = this;
                this._element = t, this._scrollElement = "BODY" === t.tagName ? window : t, this._config = this._getConfig(e), this._selector = this._config.target + " " + g + "," + this._config.target + " " + _ + "," + this._config.target + " " + m, this._offsets = [], this._targets = [], this._activeTarget = null, this._scrollHeight = 0, o(this._scrollElement).on(a.SCROLL, function (t) {
                    return n._process(t)
                }), this.refresh(), this._process()
            }
            var t = r.prototype;
            return t.refresh = function () {
                var e = this,
                    t = this._scrollElement === this._scrollElement.window ? v : E,
                    r = "auto" === this._config.method ? t : this._config.method,
                    i = r === E ? this._getScrollTop() : 0;
                this._offsets = [], this._targets = [], this._scrollHeight = this._getScrollHeight(), o.makeArray(o(this._selector)).map(function (t) {
                    var e, n = Util.getSelectorFromElement(t);
                    if (e = n ? o(n)[0] : e) {
                        t = e.getBoundingClientRect();
                        if (t.width || t.height) return [o(e)[r]().top + i, n]
                    }
                    return null
                }).filter(function (t) {
                    return t
                }).sort(function (t, e) {
                    return t[0] - e[0]
                }).forEach(function (t) {
                    e._offsets.push(t[0]), e._targets.push(t[1])
                })
            }, t.dispose = function () {
                o.removeData(this._element, i), o(this._scrollElement).off(e), this._element = null, this._scrollElement = null, this._config = null, this._selector = null, this._offsets = null, this._targets = null, this._activeTarget = null, this._scrollHeight = null
            }, t._getConfig = function (t) {
                var e;
                return "string" != typeof (t = _extends({}, s, t)).target && ((e = o(t.target).attr("id")) || (e = Util.getUID(n), o(t.target).attr("id", e)), t.target = "#" + e), Util.typeCheckConfig(n, t, l), t
            }, t._getScrollTop = function () {
                return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop
            }, t._getScrollHeight = function () {
                return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight)
            }, t._getOffsetHeight = function () {
                return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height
            }, t._process = function () {
                var t = this._getScrollTop() + this._config.offset,
                    e = this._getScrollHeight(),
                    n = this._config.offset + e - this._getOffsetHeight();
                if (this._scrollHeight !== e && this.refresh(), n <= t) {
                    n = this._targets[this._targets.length - 1];
                    this._activeTarget !== n && this._activate(n)
                } else {
                    if (this._activeTarget && t < this._offsets[0] && 0 < this._offsets[0]) return this._activeTarget = null, void this._clear();
                    for (var r = this._offsets.length; r--;) this._activeTarget !== this._targets[r] && t >= this._offsets[r] && (void 0 === this._offsets[r + 1] || t < this._offsets[r + 1]) && this._activate(this._targets[r])
                }
            }, t._activate = function (e) {
                this._activeTarget = e, this._clear();
                var t = (t = this._selector.split(",")).map(function (t) {
                        return t + '[data-target="' + e + '"],' + t + '[href="' + e + '"]'
                    }),
                    t = o(t.join(","));
                t.hasClass(c) ? (t.closest(p).find(y).addClass(f), t.addClass(f)) : (t.addClass(f), t.parents(u).prev(g + ", " + _).addClass(f), t.parents(u).prev(d).children(g).addClass(f)), o(this._scrollElement).trigger(a.ACTIVATE, {
                    relatedTarget: e
                })
            }, t._clear = function () {
                o(this._selector).filter(h).removeClass(f)
            }, r._jQueryInterface = function (n) {
                return this.each(function () {
                    var t = o(this).data(i),
                        e = "object" === _typeof(n) && n;
                    if (t || (t = new r(this, e), o(this).data(i, t)), "string" == typeof n) {
                        if (void 0 === t[n]) throw new TypeError('No method named "' + n + '"');
                        t[n]()
                    }
                })
            }, _createClass(r, null, [{
                key: "VERSION",
                get: function () {
                    return "4.0.0"
                }
            }, {
                key: "Default",
                get: function () {
                    return s
                }
            }]), r
        }();
    return o(window).on(a.LOAD_DATA_API, function () {
        for (var t = o.makeArray(o(r)), e = t.length; e--;) {
            var n = o(t[e]);
            T._jQueryInterface.call(n, n.data())
        }
    }), o.fn[n] = T._jQueryInterface, o.fn[n].Constructor = T, o.fn[n].noConflict = function () {
        return o.fn[n] = t, T._jQueryInterface
    }, T
}($);
$(document).ready(function () {
    $("#toc").is(":visible") && ($(".section-nav").addClass("list-group"), $(".section-nav ul").each(function () {
        $(this).addClass("list-group")
    }), $(".section-nav li a").each(function () {
        var t = $(this).attr("href"),
            t = decodeURIComponent(t);
        $(this).attr("href", t), $(this).addClass("list-group-item")
    }), $("body").scrollspy({
        target: "#toc"
    }))
});